﻿using System;
using System.ComponentModel;

using Styx;
using Styx.Helpers;
using DefaultValue = Styx.Helpers.DefaultValueAttribute;

using Paladin = Crusader.Routine.Paladin;

namespace Crusader
{
    internal class Settings : Styx.Helpers.Settings
    {

        private static Settings _instance;
        public static Settings Instance { get { if (_instance == null)_instance = new Settings(); return _instance; } }

        public enum Tier
        {
            None = 0,
            T14,
            T14_15,
            T15
        }

        public enum CD
        {
            No = 0,
            DuringCoolDown,
            OnCooldown,
            LowHealth
        }

        public enum AllowBuff
        {
            Disabled,
            Enabled,
            WellFed
        }

        private Settings()
            : base(".\\settings\\Crusader_" + StyxWoW.Me.Name + ".xml")
        {
        }

        #region Paladin

        [Setting]
        [DefaultValue(Paladin.Seal.None)]
        [Category("Paladin: General")]
        [DisplayName("Seal")]
        [Description("Which Seal should be used.")]
        public Paladin.Seal Paladin_Seal { get; set; }

        [Setting]
        [DefaultValue(Paladin.Blessings.None)]
        [Category("Paladin: General")]
        [DisplayName("Blessing")]
        [Description("Which Blessing should be used. NYI")]
        public Paladin.Blessings Paladin_Blessings { get; set; }

        #region Ret

        [Setting]
        [DefaultValue(false)]
        [Category("Paladin: Ret")]
        [DisplayName("Allow auto targeting.")]
        [Description("Allow best targeting,  note this may not work correctly yet.")]
        public bool AllowTargeting { get; set; }
        

        [Setting]
        [DefaultValue(0)]
        [Category("Paladin: Ret")]
        [DisplayName("Different Rotation")]
        [Description("Used for different Rotations. Currently only one.\n 0 : Inq > 5HP TV > HoW > Exo > CS > Judge > 3-4HP TV")]
        public int Paladin_Ret_Rotation { get; set; }

        [Setting]
        [DefaultValue(Tier.None)]
        [Category("Paladin: Ret")]
        [DisplayName("Set Bonus")]
        [Description("Manually set what teir you are wearing.")]
        public Tier Paladin_Ret_Tier { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("Paladin: Ret")]
        [DisplayName("Divine Storm")]
        [Description("Number of mobs when \"Divine Storm\" should be used instead of \"Templar's Verdict\". Deafult=2")]
        public int Paladin_Ret_DSOverTV { get; set; }

        [Setting]
        [DefaultValue(4)]
        [Category("Paladin: Ret")]
        [DisplayName("Hammer of the Righteous")]
        [Description("Number of mobs when \"Hammer of the Righteous\" should be used instead of \"Crusader Strike\". Default=4")]
        public int Paladin_Ret_HotROverCS { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("Paladin: Ret")]
        [DisplayName("Flash of Light")]
        [Description("When should Flash of Light be used to heal.  Note: requires three stacks of selfless healer.")]
        public int Paladin_Ret_WoG { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("Paladin: Ret")]
        [DisplayName("WoG")]
        [Description("When should WoG be used to heal.  Note only used @ 3 Holy Power.")]
        public int Paladin_Ret_FL { get; set; }

        [Setting]
        [DefaultValue(8)]
        [Category("Paladin: Ret")]
        [DisplayName("Seal switch for AoE")]
        [Description("How many adds before seal switch for AoE.")]
        public int Paladin_Ret_SealSwitch { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Paladin: Ret")]
        [DisplayName("Sacred Shield")]
        [Description("Use Sacred Shield if Talented.")]
        public bool Paladin_Ret_UseSS { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Paladin: Ret")]
        [DisplayName("Double Jeopardy")]
        [Description("Judgment on a different target everytime to get bonus damage from Double Jeopardy Glyph, will not break CC'd targets.")]
        public bool Paladin_Ret_JudgmentBonus { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Paladin: Ret")]
        [DisplayName("Ranged rotation")]
        [Description("If out of melee range, a special ranged rotation will be used.")]
        public bool Paladin_Ret_UseRanged_Rotation { get; set; }

        [Setting]
        [DefaultValue(CD.OnCooldown)]
        [Category("Paladin: Ret")]
        [DisplayName("Use ES?")]
        [Description("Use ES")]
        public CD Paladin_Ret_ExS { get; set; }

        #endregion

        #region Prot

        [Setting]
        [DefaultValue(0)]
        [Category("Paladin: Prot")]
        [DisplayName("WoG")]
        public int Paladin_Prot_WoG { get; set; }

        [Setting]
        [DefaultValue(0)]
        [DisplayName("Lay on Hands")]
        [Category("Paladin: Prot")]
        public int Paladin_Prot_UseLoH { get; set; }

        [Setting]
        [DefaultValue(0)]
        [DisplayName("Ardent Defender")]
        [Category("Paladin: Prot")]
        public int Paladin_Prot_UseAD { get; set; }

        [Setting]
        [DefaultValue(4)]
        [Category("Paladin: Prot")]
        public int Paladin_Prot_AoE { get; set; }

        [Setting]
        [DefaultValue(8)]
        [Category("Paladin: Prot")]
        [DisplayName("Seal switch for AoE")]
        [Description("How many adds before seal switch for AoE.")]
        public int Paladin_Prot_SealSwitch { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("Paladin: Prot")]
        [DisplayName("Keep 'Weakened Blows' up.")]
        [Description("Keep 'Weakened Blows' debuff up on single targets.")]
        public bool Paladin_Prot_WeakenedBlows { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Paladin: Prot")]
        [DisplayName("Double Jeopardy")]
        [Description("(NYI not enough information about where it should be in rotation.) \nJudgment on a different target everytime to get bonus damage from Double Jeopardy Glyph, will not break CC'd targets.")]
        public bool Paladin_Prot_JudgmentBonus { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Paladin: Prot")]
        [DisplayName("Sacred Shield")]
        [Description("Use Sacred Shield if Talented.")]
        public bool Paladin_Prot_UseSS { get; set; }

        #endregion
        #endregion

        //

        #region General

        [Setting]
        [Category("General")]
        [DisplayName("Spells to interupt")]
        [Description("Which spells to interupt, NYI")]
        public String[] InteruptSpellList { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("General")]
        public bool DisableRotation { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("General")]
        public bool AllowAoE { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("General")]
        public bool UseCooldowns { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("General")]
        public bool UseDPSPot { get; set; }

        [Setting]
        [DefaultValue(CD.No)]
        [Category("General")]
        public CD UseGloves { get; set; }

        [Setting]
        [DefaultValue(CD.No)]
        [Category("General")]
        public CD UseTrinket1 { get; set; }

        [Setting]
        [DefaultValue(CD.No)]
        [Category("General")]
        public CD UseTrinket2 { get; set; }

        [Setting]
        [DefaultValue(AllowBuff.Disabled)]
        [Category("General")]
        public AllowBuff RaidBuffs { get; set; }

        [Setting]
        [DefaultValue(10)]
        [Category("General")]
        public int AoERange { get; set; }

        [Setting]
        [DefaultValue(80)]
        [Category("General")]
        public int HealthLightwell { get; set; }

        #endregion

    }
}
